I don't know if this thread is still active but I stumbled upon it while looking for answers for a QtWebkit problem I'm facing. Anyway...
I would go about this by using my own QNetworkAccessManager based class. Create a slot function that is connected to the finished signal from that class. I haven't tested this theory, but it should be something along the lines of -
void QNAMProxy::HandleFinished( QNetworkReply* reply ) {
if( reply->error( )) {
// Something went wrong
} else {
QUrl url
= reply
->url
( );
//TODO Parse the URL to create your local path
QFile file( "Parsed local file name" );
// Some problem with creating the file to write
} else {
file.write( reply->readAll( ));
file.close( );
}
}
}
void QNAMProxy::HandleFinished( QNetworkReply* reply ) {
if( reply->error( )) {
// Something went wrong
} else {
QUrl url = reply->url( );
//TODO Parse the URL to create your local path
QFile file( "Parsed local file name" );
if (!file.open(QIODevice::WriteOnly)) {
// Some problem with creating the file to write
} else {
file.write( reply->readAll( ));
file.close( );
}
}
}
To copy to clipboard, switch view to plain text mode
This should give you the basis of what you need.
Bookmarks